"""
Support for using textile to markup posts, and comments
"""
__revision__ = "$Id: textilizer.py 46 2007-03-12 09:42:24Z jens.persson $"

from worde import plugins

try:
    import textile
except ImportError:
    from os.path import dirname, join
    import sys
    sys.path.append(join(dirname(__file__), "..", "external", "textile"))


class Textile(plugins.Plugin):
    """
    Render the post from textile to (X)HTML

    for more info about Textile see:
    http://www.textism.com/tools/textile/
    """
    def prerender(self, text):
        "Handle posts"
        print textile.__file__
        return textile.textile(text)